package com.lcxw.hxzbadmin.dao.configmapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import com.lcxw.hxzbadmin.entity.configbean.YwpdCarousel;

public interface CarouselMapper {

    @Delete({
        "delete from ywpd_carousel",
        "where `id` = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into ywpd_carousel (`linkUrl`, `description`, ",
        "`title`, `picPath`, ",
        "`orderNo`, `addTime`)",
        "values (#{linkUrl,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, ",
        "#{title,jdbcType=VARCHAR}, #{picPath,jdbcType=VARCHAR}, ",
        "#{orderNo,jdbcType=INTEGER}, #{addTime,jdbcType=INTEGER})"
    })
    int insert(YwpdCarousel record);

    @Select({
        "select",
        "*",
        "from ywpd_carousel",
        "where `id` = #{id,jdbcType=INTEGER}"
    })
    YwpdCarousel selectByPrimaryKey(Integer id);

    @Select({
        "select",
        "*",
        "from ywpd_carousel"
    })
    List<YwpdCarousel> selectAll();

    @Update({
        "update ywpd_carousel",
        "set `linkUrl` = #{linkUrl},",
        "`description` = #{description},",
        "`title` = #{title},",
        "`picPath` = #{picPath},",
        "`orderNo` = #{orderNo},",
        "`addTime` = #{addTime}",
        "where `id` = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(YwpdCarousel record);


}
